package com.yyryyty.chapter5;

import java.util.stream.IntStream;

/**
 * @Description :
 * @Author : YTY
 * @Date : 2021-01-17 19:03
 */
public class NumericStreams {

    public static void main(String[] args) {

//        System.out.println(menu.stream()
//                .mapToInt(Dish::getCalories)
//                .average().getAsDouble());

//        System.out.println(menu.stream()
//                .mapToInt(Dish::getCalories)
//                .max()
//                .orElse(1));

        System.out.println(IntStream.range(1, 100)
                .filter(n -> n % 2 == 0)
                .count());

    }
}
